{% extends base.html %}

{% block head %}
<style type="text/css">
    .notice-link {
        color: orange;
    }
</style>
{% end %}

{% block body %}
{% set get_short_text = xutils.get_short_text %}
{% set msg_len = 15 %}
{% set notice_list1 = xconfig.get_notice_list('today', _user_name) %}
{% set notice_list2 = xconfig.get_notice_list('tomorrow', _user_name) %}

{% if len(notice_list1+notice_list2) > 0 %}
<div class="col-md-12 bottom-offset-1">
    <div class="grid-title">提醒</div>
    <div class="grid-row">
    {% for item in notice_list1 %}
        <div class="grid-item info">
          <a class="link" href="{{item.link}}">{{get_short_text(item.message, msg_len)}}</a>
        </div>
    {% end %}
    {% for item in notice_list2 %}
        <div class="grid-item">
          <a class="link" href="{{item.link}}">明天 - {{get_short_text(item.message, msg_len)}}</a>
        </div>
    {% end %}
    </div>
</div>
{% end %}

<div class="col-md-12 bottom-offset-1">
    <div class="grid-title">
        工具库
        <a class="link float-right" href="/more?type=tool">更多</a>
    </div>
    <div class="grid-row">
        {% for item in tools %}
            <div class="grid-item">
                <a class="link" href="{{item.link}}">{{item.name}}</a>
            </div>
        {% end %}
    </div>
</div>

<div class="col-md-12 bottom-offset-1">
    <div class="grid-title">文档库
        {% if _has_login %}
        <a class="float-right link prompt-btn" message="新增分类" 
                    action="/note/add?type=group&name=">新增</a>
        {% end %}
    </div>
    {% include "note/group_list.html" %}
</div>

{% end %}

{% block aside %}
    {% include note/mod_aside.html %}
{% end %}
